//
// Created by ds on 24-7-3.
//

#ifndef BRIDGEHELPER_H
#define BRIDGEHELPER_H

#include <carla/Memory.h>
#include <carla/client/BlueprintLibrary.h>
#include <carla/geom/Transform.h>

#include "SumoEntity.h"
#include "json.hpp"

class BridgeHelper {
public:
    BridgeHelper();

    static NetOffset netOffset;
    static map<string, string> vTypes;
    static carla::SharedPtr<carla::client::BlueprintLibrary> blueprintLibrary;

    /**
     * 基于sumo的坐标和方向，转换成carla的transform
     * @param sumoActor SumoActor
     * @return carla::geom::Transform
     */
    static carla::geom::Transform getCarlaTransform(const SumoActor &sumoActor, bool floatAir);

    /**
     * 根据sumo的车的类型从carla车蓝图中选择合适的蓝图
     * @param sumoActor SumoActor
     * @return carla::client::ActorBlueprint
     */
    static const carla::client::ActorBlueprint *getCarlaBlueprint(const SumoActor& sumoActor);

private:
    /**
     * 根据sumo的车的类型从定义的备选蓝图中选择合适的蓝图
     * @param sumoActor SumoActor
     * @return carla::client::ActorBlueprint
     */
    static carla::client::ActorBlueprint *getRecommendedCarlaBlueprint(const SumoActor& sumoActor);
};


#endif //BRIDGEHELPER_H
